package com.xiaoxing.yunshu.mvp.ui.receiver;

import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * @ProjectName: Xiaoxing_YunShu_20200206_QingDao
 * @Package: com.xiaoxing.yunshu.mvp.ui.receiver
 * @ClassName: NotificationBroadcastReceiver
 * @Description: java类作用描述
 * @Author: 小星
 * @CreateDate: 2020/7/30 0030 13:50
 * @UpdateUser: 更新者：
 * @UpdateDate: 2020/7/30 0030 13:50
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */
public  class NotificationBroadcastReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {

        String action = intent.getAction();
        int type = intent.getIntExtra("type", -1);

        if (type != -1) {
            NotificationManager notificationManager =
                    (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
            notificationManager.cancel(type);
        }

        if (action.equals("notification_cancelled")) {
            //处理滑动清除和点击删除事件

        }

    }
}